package biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import dao.CarDao;
import entity.Car;
import biz.CarBiz;

public class CarBizImpl implements CarBiz {
	private CarDao carDao;

	public Integer count(){
		return carDao.count();
	}
	public List<Car> findByPage(Integer pageNo, Integer rows){
		Map map = new HashMap();
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		return carDao.findByPage(map);
	}
	public CarDao getCarDao() {
		return carDao;
	}

	public void setCarDao(CarDao carDao) {
		this.carDao = carDao;
	}

	public List<Car> findAll() {
		return carDao.findAll();
	}

	public Car findById(Integer id) {
		return carDao.findById(id);
	}

	public int add(Car car) {	
		return carDao.add(car);		
	}

	public int delete(Car car) {
		return carDao.delete(car);
	}

	public int update(Car car) {
		return carDao.update(car);
	}

	public List<Car> findByParam(Map map) {
		// TODO Auto-generated method stub
		return null;
	}

}
